home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Tools⁄Additions / MacScheme20 / Compatibility / streams.sch < prev    next >
Encoding:
Text File  |  1986-08-16  |  277 b   |  12 lines  |  [TEXT/EDIT]

  1. ; Stream hackery from Abelson and Sussman, section 3.4.
  2.  
  3. (macro cons-stream
  4.    (lambda (l)
  5.       `(cons ,(cadr l) (delay ,(caddr l)))))
  6.  
  7. (define (head stream) (car stream))
  8. (define (tail stream) (force (cdr stream)))
  9.  
  10. (define empty-stream? null?)
  11. (define the-empty-stream '())
  12.